/**********************************************************************
 *
 *  MODULE: GDOC.H
 *  AUTHOR: BRIAN M. WORKMAN
 *  START DATE: 3/3/2006 9:19:09 PM
 *
 **********************************************************************/

#ifndef __GDOC_H_
#define __GDOC_H_

#include <QtGui>
#include <QFontMetrics>

class GDoc : public QTextEdit
{
    Q_OBJECT

public:
    GDoc ( QWidget * parent = 0 );
    void setFont(QFont font);
    QFont font() const;
    bool dirty() const;
    QString pad() const;
    void setPad(QString pad);
    void setText(QString text);
    QString text() const;
    bool mudFriendly() const;
    void setMudFriendly(bool yn);
    int wrapColumn() const;
    int textIndent() const;
    bool checkForDot() const;
    void setCheckForDot(bool yn);
    

public slots:
    void setWrapColumn(int i);
    void setTextIndent(int i);
    void copy();
    void paste();    

protected:
    void keyPressEvent ( QKeyEvent *e ) ;
    void paintEvent ( QPaintEvent *e );
    void mousePressEvent (QMouseEvent *e);

private:
    QFontMetrics *m_fm;
    int m_wrap;
    int m_indent;
    Qt::BrushStyle brushtype;
    int m_gutter_x;
    QString m_pad;
    bool m_mudfriendly;
    bool m_dot;
    QWidget *m_parent;
 

signals:
    void lastPathChanged(QString);
};

#endif // __GDOC_H_
